package br.edu.ufcg.lsd.wbis.ui.client.services;

import java.util.List;

import br.edu.ufcg.lsd.wbis.ui.client.beans.EquipInfo;
import br.edu.ufcg.lsd.wbis.ui.client.beans.UserInfo;
import br.edu.ufcg.lsd.wbis.ui.client.beans.UserMatcher;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

/**
 * @author Renato Miceli
 */
@RemoteServiceRelativePath("USER_SERVICE")
public interface UserService extends RemoteService {

	public static class Util {

		public static UserServiceAsync getInstance() {

			return GWT.create(UserService.class);
		}
	}

	public UserInfo registerUser(String login, String password, UserInfo newInfo);
	
	public void removeUser(String login, String password, String userLogin);
	
	public UserInfo updatePersonalInfo(String login, String password, UserInfo newInfo);

	public UserInfo changePassword(String login, String password, UserInfo newInfo);

	public UserInfo getUserInfo(String login, String password, String userLogin);

	public List<UserInfo> getRandomUserInfos(String login, String password, int number);

	public List<UserInfo> getRandomUnauthorizedUserInfos(UserInfo requester);

	public void authorizeUser(String login, String password, String loginToAuthorize);

	public List<String> getUsersNames(String login, String password);

	public List<UserInfo> getAllUserInfos(String login, String password);

	public List<UserInfo> searchUsers(UserInfo requester, UserMatcher matcher);

	public List<EquipInfo> getAllEquipmentInfos(String requesterLogin, String requesterPassword);

}
